/**
 * 
 */
package org.t2.game.server.module.data.model;

import org.banish.sql.core.annotation.Column;
import org.banish.sql.core.annotation.Id;
import org.banish.sql.core.annotation.SplitTable;
import org.banish.sql.core.annotation.Id.Strategy;
import org.banish.sql.core.annotation.enuma.AsyncType;
import org.banish.sql.core.entity.AbstractEntity;
import org.gaming.service.repository.annotation.NoCache;
import org.gaming.tool.DateTimeUtil;
import org.springframework.stereotype.Repository;

/**
 * @author YY
 */
@Repository
@NoCache
@SplitTable(comment = "数据日志表", dbAlias = "log", asyncType = AsyncType.INSERT, byColumn = "time", asyncDelay = 60)
public class DataLog extends AbstractEntity {
	@Id(strategy = Strategy.AUTO)
	@Column(comment = "唯一ID")
	private long id;
	@Column(comment = "操作")
	private String operation;
	@Column(comment = "原因")
	private String reason;
	@Column(name = "player_id", comment = "玩家ID")
	private long playerId;
	@Column(name = "data_type", comment = "数据类型")
	private String dataType;
	@Column(name = "data_id", comment = "数据ID")
	private int dataId;
	@Column(comment = "明文数据", extra = "text")
	private String plaintext;
	@Column(comment = "发生时间", extra = "time")
	private long time = DateTimeUtil.currMillis();
	
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	public String getOperation() {
		return operation;
	}
	public void setOperation(String operation) {
		this.operation = operation;
	}
	public String getDataType() {
		return dataType;
	}
	public void setDataType(String dataType) {
		this.dataType = dataType;
	}
	public int getDataId() {
		return dataId;
	}
	public void setDataId(int dataId) {
		this.dataId = dataId;
	}
	public String getReason() {
		return reason;
	}
	public void setReason(String reason) {
		this.reason = reason;
	}
	public long getPlayerId() {
		return playerId;
	}
	public void setPlayerId(long playerId) {
		this.playerId = playerId;
	}
	public long getTime() {
		return time;
	}
	public void setTime(long time) {
		this.time = time;
	}
	public String getPlaintext() {
		return plaintext;
	}
	public void setPlaintext(String plaintext) {
		this.plaintext = plaintext;
	}
}
